package com.design.behavior.command.cainiao;

/**
 * @ProjectName: design
 * @Package: com.design.behavior.command.cainiao
 * @ClassName: CommandPatternDemo
 * @Author: shenaiguo
 * @Description: 使用 Broker 类来接受并执行命令。
 * @Date: 2020/10/1 0001 11:01
 */
public class CommandPatternDemo {
    public static void main(String[] args) {
        Stock abcStock = new Stock();

        BuyStock buyStockOrder = new BuyStock(abcStock);
        SellStock sellStockOrder = new SellStock(abcStock);

        Broker broker = new Broker();
        broker.takeOrder(buyStockOrder);
        broker.takeOrder(sellStockOrder);

        broker.placeOrders();
    }
}
